package com.yangyu.controller;

import com.yangyu.message.BaseRsp;
import com.yangyu.pojo.Message;
import com.yangyu.service.MessageService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author
 * @version V1.0
 * @Package com.yangyu.controller
 * @date 2020/12/20 21:43
 */
@Api(tags = "评论模块")
@RestController
@RequestMapping("/message")
public class MessageController {

    @Autowired
    private MessageService commentService;


    @PostMapping("/addMessage")
    public BaseRsp addComment(@RequestBody Message comment) {
        return commentService.addComment(comment);
    }


    @GetMapping("/getMessage")
    public BaseRsp getMessage() {
        return commentService.getCommentByBlogId();
    }
}
